Technology Field
The invention relates to a writing method, and more particularly, to a writing method for a rewritable non-volatile memory module, and a memory controller and a memory storage device using the same.
Description of Related Art
The markets of digital cameras, cellular phones, and MP3 players have expanded rapidly in recent years, resulting in escalated demand for storage media by consumers. The characteristics of data non-volatility, low power consumption, and compact size make the rewritable non-volatile memory module (e.g., flash memory) ideal for being built in the portable multi-media devices as cited above.
A common rewritable non-volatile memory module usually includes multiple physical blocks, and each physical block includes multiple physical pages. Since a filled physical block before being erased cannot be used for re-writing data, when a host system intends to update data in the filled physical block, the data is first being written in another unfilled physical bock. In this case, the another unfilled physical block is stored with a valid data corresponding to data pending for being updated in the filled physical block, and the data pending for being updated in the filled physical block is then invalidated and retained in the filled physical block. When the host system continues to write data while all of the physical block are stored with the valid data and the invalid data at the same time (or when remaining physical blocks are less than a predetermined amount), a merging operation to these physical blocks is required. The merging operation refers to moving or copying the valid data on multiple physical blocks to one spare physical block, such that one physical block filled with the valid data and the invalid data can be erased so as to be used for storing other data. However, the merging operation for the valid data across multiple physical blocks may cost a lot of time, and the host system cannot wait for exceeding a predetermined time once a write command is issued. Accordingly, how to ensure that the host system does not wait for too long in any case has become one of the major subjects in the industry for person skilled in the art.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.